<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>List</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-table.min.css">
    <script src="../js/jquery-3.3.1.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/bootstrap-table.min.js"></script>
    <script src="../js/bootstrap-table-zh-CN.min.js"></script>
</head>
<body>
<table id="list_table">
    <tr>
        <td>ID</td>
        <td>标题</td>
    </tr>

</table>
</body>
<script>
    $(function () {
        $.ajax({
            url: "/question/list",
            success: function (result) {
                var questionList = result.rows;
                for (var i = 0; i < questionList.length; i++) {
                    var str = '<tr>\n' +
                        '        <td>' + questionList[i].id + '</td>\n' +
                        '        <td><a href="answer_show.html?qid=' + questionList[i].id + '">' + questionList[i].title + '</a></td>\n' +
                        '    </tr>';
                    $("#list_table").append(str);
                }
            }
        })
    });
</script>
</html>